package com.example.springboot1.mapper;

import com.example.springboot1.pojo.City;
import lombok.Data;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

@Mapper
@Component
public interface  CityMapper {
    @Select("select * from city where id = #{id}")
    City getCityById(Integer id);

    @Insert("insert into city (name,state,country) values (#{name},#{satae},#{country})")
    int InsertCity (City city);

    @Update("update city set name = #{name},state = #{state},country = #{country})")
    int updateCity (City city);

    @Delete("delete from city where id = #{id}")
    int deleteCity (Integer id);
}
